package com.xuzhen.designPattern.decorator.one;

//http://www.cnblogs.com/yeslove/archive/2011/04/23/2025642.html
public class Test {
	public static void main(String[] args) {
		//第一个手机  
        Phone p1 = new PhoneSon("诺基亚", "5230");  //实例化1个手机
        DecoratorA A = new DecoratorA(p1);    //装饰它的功能
        A.function();

        System.out.println("----------------");
        //第二个手机
        Phone p2=new PhoneSon("HTC","G7");  //实例化
        DecoratorA A1 = new DecoratorA(p2); //装饰它的功能
        DecoratorB b1 = new DecoratorB(A1);
        b1.function();

	}
}
